﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Super.Entities;
using Super.Infrastructure;

namespace Super.DomainService
{
   public class UserService:BaseService<User>
   {
       private readonly DbContextAdapter _adp;
       private readonly BaseService<User> _userService;
       public UserService(DbContextAdapter adapter): base(adapter)
        {
            _adp = adapter;
           _userService=new BaseService<User>(_adp);
          
        }

       /// <summary>
       /// 根据用户ID获取用户实体
       /// </summary>
       /// <param name="userId"></param>
       /// <returns></returns>
       public User GetUserById(int userId)
       {
          return  _userService.Repository.Find(a => a.ID == userId).FirstOrDefault();
       }
    }
}
